<?php 
include("conexion.php");
$tipoper = $_POST['tipoper'];
$tipodoc = $_POST['tipodoc'];
$numdoc  = $_POST['numdoc'];

$sqlclie=mysql_query("select * from cliente where  numdoc = '$numdoc' and (tipper='$tipoper' and idtipdoc='$tipodoc')", $conn) or die(mysql_error());
$row=mysql_fetch_array($sqlclie);
if (!empty($row)){
	 if ($row['tipocli']=="0"){
	    if ($row['tipper']=="N"){
		 include("mostrarcliente.php");
		}else{
		  if($row['numdoc']==''){
			  include("mostrarnewclienteruc.php");
		  
	          }	else{ include ("mostrarempresa.php");
				  }    
			} 
	 }else{
	   if ($row['tipper']=="N"){
		 include("mostrarimpedido.php");
		}else{ 
		  include ("mostrarempresa2.php");}
	 }
}else{
    if ($tipoper!="N"){
	  include("mostrarnewclienteruc.php"); 
	 }else{
	   include("mostrarnewclientedni.php");
	 }
}

 
?>
